2 of 14
"State of the Union"
It's probably safe to say that
most CF developers start out using session-scoped variables to
manage client state. Session variables are fast and easy to use. In
addition, there seems to have always been some confusion over the
differences between client and session variables. Since session
variables are most often discussed in the newsgroups, and are most
frequently found in the various code examples in help screens,
newsgroups and books, the implementation of session variables can be
considered the most common method of client state management for new
to intermediate CF developers.
Furthermore, it's also safe to say that "newbie" CF developers
have no inherent need to work with any other method of client state
management, since they're working primarily within a single-server
environment. Since a single-server development or production
platform poses no problems for developers using session variables
for client state management, the session scope is an excellent
choice.
A Clustering "Primer"
There are times, however, when
using session variables can get you into trouble - specifically when
running the application in a clustered-server environment. Before I
address this problem, let's talk about what a clustered server
environment really is. While an in-depth discussion of clustering is
beyond the scope of this article, I will offer this brief "primer."
Configuring a cluster involves installing either hardware or
software into the network infrastructure that will load-balance a
Web site or Web application across multiple servers. This provides
scalability: as usage of a Web site or Web application grows and
server traffic increases, more horsepower can easily be added to the
mix to compensate.
This article considers a specific and common configuration:
ColdFusion 4+ with BrightTiger's ClusterCATS. In the CF/ClusterCATS
configuration, the ClusterCATS software component connects two or
more ColdFusion Web servers together, allowing them to share the
work of processing and serving up Web pages. It also provides an
element of fault tolerance; should one of the machines become
unavailable (because of a hardware, software or network failure),
the "load" is shifted to the remaining machine(s). All of this
clustering functionality is (or should be!) transparent to the
users.
2 of 14